﻿using System;
using System.ComponentModel.DataAnnotations;

namespace BLL.Services.Responses.Listing
{
    public class ResponseFilter
    {
        [ScaffoldColumn(false)]
        public int UserId { get; set; }

        [Display(Name = "User Email")]
        public string UserEmail { get; set; }

        [ScaffoldColumn(false)]
        public int BookId { get; set; }

        [Display(Name = "Book Title")]
        public string BookTitle { get; set; }

        [Display(Name = "Date From")]
        public DateTime? DateFrom { get; set; }

        [ScaffoldColumn(false)]
        public string DateFromAsString
        {
            get
            {
                if (DateFrom.HasValue)
                {
                    return DateFrom.Value.ToShortDateString();
                }
                return string.Empty;
            }
        }

        [Display(Name = "Date To")]
        public DateTime? DateTo { get; set; }

        [ScaffoldColumn(false)]
        public string DateToAsString
        {
            get
            {
                if (DateTo.HasValue)
                {
                    return DateTo.Value.ToShortDateString();
                }
                return string.Empty;
            }
        }
    }
}